const BaseController = require('./BaseController.js');

class ArticleController extends BaseController {
  // 文章列表
  async article_list(){
	  const { ctx } = this
    let params = await this.getParams(ctx)
    let result = await ctx.service.article.list(params)
	  this.showSuccess(result)
  }

  // 文章详情
  async article_detail(){
    const { ctx } = this
    let params = await this.getParams(ctx)
    let result = await ctx.service.article.detail(params)
	  this.showSuccess(result)
  }

  // 新增
  async article_create(){
    const { ctx } = this
    let params = await this.getParams(ctx)
    let result = await ctx.service.article.create(params)
	  this.showSuccess(result)
  }

  // 导入
  async article_createAll(){
    const { ctx } = this
    let params = await this.getParams(ctx)
    let result = await ctx.service.article.createAll(params)
	  this.showSuccess(result)
  }

  // 编辑内容
  async article_edit(){
    const { ctx } = this
    let params = await this.getParams(ctx)
    let result = await ctx.service.article.edit(params)
	  this.showSuccess(result)
  }

  // 删除
  async article_delete(){
    const { ctx } = this
    let params = await this.getParams(ctx)
    let result = await ctx.service.article.deleteItem(params)
	  this.showSuccess(result)
  }

  // 文章类型列表
  async article_type_list(){
	  const { ctx } = this
    let params = await this.getParams(ctx)
    let result = await ctx.service.article.type_list(params)
	  this.showSuccess(result)
  }

  // 使用数据类型列表
  async data_type_list(){
	  const { ctx } = this
    let params = await this.getParams(ctx)
    let result = await ctx.service.article.data_type_list(params)
	  this.showSuccess(result)
  }

  // 疾病子类列表
  async disease_type_list(){
	  const { ctx } = this
    let params = await this.getParams(ctx)
    let result = await ctx.service.article.disease_type_list(params)
	  this.showSuccess(result)
  }
}

module.exports = ArticleController;